package com.lfk.three.item;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.HashMap;

/**
 * 网络队列子节点
 * Created by liufengkai on 16/4/9.
 */
public class NetItem implements Parcelable {
    public String callback_name;
    public String url;
    public HashMap<String, String> params;

    public NetItem(String callback_name, String url, HashMap<String, String> params) {
        this.callback_name = callback_name;
        this.url = url;
        this.params = params;
    }

    protected NetItem(Parcel in) {
        callback_name = in.readString();
        url = in.readString();
        params = in.readHashMap(HashMap.class.getClassLoader());
    }

    public static final Creator<NetItem> CREATOR = new Creator<NetItem>() {
        @Override
        public NetItem createFromParcel(Parcel in) {
            return new NetItem(in);
        }

        @Override
        public NetItem[] newArray(int size) {
            return new NetItem[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(callback_name);
        dest.writeString(url);
        dest.writeMap(params);
    }
}
